<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title></title>
    <script type="text/javascript">
        window.onload = function() {
            document.execCommand("MultipleSelection", true, true);
            var input1 = document.getElementById("i1"), input2 = document.getElementById("i2");
            var controlRange = document.body.createControlRange();
            controlRange.addElement(input1);
            controlRange.addElement(input2);
            controlRange.select();
            controlRange.remove(input1);
            input1.parentNode.removeChild(input1);
            controlRange.remove(input2);
            input2.parentNode.removeChild(input2);
            alert("Type before creating range: " + document.selection.type);
            var sel = document.selection;
            var range = document.selection.createRange();
            var sel2 = document.selection;
            var selChanged = (sel != sel2);
            var rangeType = (typeof range.text == "undefined") ? "ControlRange" : "TextRange";
            alert("Type after creating range: " + document.selection.type + ". Range type: " + rangeType + ", selChanged: " + selChanged);
        };
    </script>
</head>
<body>
<input id="i1"> and <input id="i2">

</body>
</html>